package cn.tedu.mall.aop;


import cn.tedu.mall.vo.SysResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice //作用是用来定义全局异常处理机制
public class RuntimeExceptions {
    @ExceptionHandler(RuntimeException.class)
    public SysResult runtime(Exception exception){
        exception.printStackTrace();
        return SysResult.fail();
    }
}
